]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
layout: Unset primary and bottom monitor when headless
authorJonas Ådahl <jadahl@gmail.com>
Sat, 7 Oct 2017 00:26:24 +0000 (20:26 -0400)
committerJonas Ådahl <jadahl@gmail.com>
Sat, 7 Oct 2017 00:31:14 +0000 (20:31 -0400)
We were handling being initially headless by only setting the primary
and bottom monitor if there was any primary monitor, then checking the
primary monitor reference before making calls assuming there was any
monitors.

What we didn't do was unset the primary and bottom monitor when going
headless, meaning that temporarly disconnecting a monitor while having
windows open caused an assert to be triggered due to various code paths
taking the path assuming there are valid monitors.

Unsetting both the primary and bottom monitor when going headless avoids
the code paths in the same way as they were avoided when starting
headless.

https://bugzilla.gnome.org/show_bug.cgi?id=788607

js/ui/layout.js

index 304c2a1521510c53e9a564b2720afd40c56f9099..2f18947750ea509de7e71add805ec883bc708de5 100644 (file)
@@ -351,6 +351,9 @@ var LayoutManager = new Lang.Class({
                 this._loadBackground();
                 this._pendingLoadBackground = false;
             }
+        } else {
+            this.primaryMonitor = null;
+            this.bottomMonitor = null;
         }
     },